import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
// ===================================================================== Declare
const { $fn } = window
// ===================================================================== Lazy
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
	}
	
	model = {}

	componentDidMount(){
		
	}
	
	load = ({ spec_code, kind_id }) => {
		this.query = { spec_code, parent_kind_id: kind_id }
		this.fetch()
	}
	
	// paging
	fetch = () => $fn.fetch.call(this, 'specimen/viewSearchDetail', {isIndex:true})

	// 表单
	cols = [
		{ title: '项目名称', 	dataIndex: 'kind_name', 		width:220 },
		{ title: '实验号', 		dataIndex: 'experiment_num', 	width:150 },
		{ title: '状态', 		dataIndex: 'status_name', 		width:60 },
		{ title: '提示', 		dataIndex: 'tips', 				width:60,	render: text => {
			if( text === '↑↑' || text === '↑' ){
				return <span style={{color:'red'}}>{text}</span>
			}else if( text === '↓↓' || text === '↓'){
				return <span style={{color:'blue'}}>{text}</span>
			}else{
				return text
			}
		} },
		{ title: '结果', 		dataIndex: 'result', 		width:150 },
		{ title: '检测时间', 	dataIndex: 'test_time',		...$fn.table.time },
		{ title: '报告时间', 	dataIndex: 'rp_date',		...$fn.table.time },
	]

	render(){
		return (
			<>
				{/* 表格 */}
				{ Table.call(this, {isIndex:true}) }
			</>
		)
	}
}

export default Index